package com.jinglin.entity.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 用户行为 点赞、评论
 * </p>
 *
 * @author ${author}
 * @since 2025-03-24
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="UserAction对象", description="用户行为 点赞、评论")
public class UserAction extends Model<UserAction> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "自增ID")
      @TableId(value = "action_id", type = IdType.ASSIGN_ID)
    private String actionId;

    @ApiModelProperty(value = "视频ID")
    private String videoId;

    @ApiModelProperty(value = "视频用户ID")
    private String videoUserId;

    @ApiModelProperty(value = "评论ID")
    private String  commentId;

    @ApiModelProperty(value = "0:评论喜欢点赞 1:讨厌评论 2:视频点赞 3:视频收藏 4:视频投币 ")
    private Integer actionType;

    @ApiModelProperty(value = "数量")
    private Integer actionCount;

    @ApiModelProperty(value = "用户ID")
    private String userId;

    @ApiModelProperty(value = "操作时间")
    private LocalDateTime actionTime;

    @TableField(exist = false)
    private String videoName;
    @TableField(exist = false)
    private String videoCover;

    /*
    * 这里做逻辑删除会和数据库里面多字段联合唯一约束进行冲突，因此我选择直接物理删除。
    *
    * */
/*    @ApiModelProperty(value = "删除为0 未删除为1")
    @TableLogic
    private Integer deleted;*/


    @Override
    protected Serializable pkVal() {
        return this.actionId;
    }

}
